package cn.nawang.ebeim.client.exception;

/**
 * @ClassName: ApiRequestException
 * @Description: TODO
 * @author fanyb
 * @date Nov 28, 2015 11:05:42 AM
 * @version v1.0
 */
public class ApiRequestException extends Exception {
  private static final long serialVersionUID = 1L;
  private String errorMessage = null;

  public ApiRequestException(String errorMessage) {
    super(errorMessage);
    this.errorMessage = errorMessage;
  }

  public ApiRequestException(Throwable e) {
    super(e);
    if (e != null) {
      this.errorMessage = e.getMessage();
    } else {
      this.errorMessage = "未知异常";
    }
  }

  public ApiRequestException(String errorMessage, Throwable e) {
    super(errorMessage, e);
    this.errorMessage = errorMessage;
  }

  public String getErrorMessage() {
    return errorMessage;
  }
}
